FROM php:7.4.30-fpm-alpine

LABEL author="who you are"
ENV myValue="jenkins for you!"

ENV PHPIZE_DEPS="autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf  \
  re2c pcre-dev pcre2-dev zlib-dev libtool oniguruma-dev  automake"
RUN set -ex \
  && sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
  # && apk --no-cache add gcc g++ make libffi-dev openssl-dev autoconf zlib-dev libpng-dev libjpeg-turbo-dev freetype-dev curl-dev \
  # libzip-dev oniguruma-dev \
  && apk update && apk add tzdata &&  cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
  && echo "Asia/Shanghai" > /etc/timezone \
  && apk add --no-cache openssl git bash libpng-dev libzip-dev libjpeg-turbo-dev freetype-dev rabbitmq-c-dev \
  && apk add --no-cache --virtual .build-deps $PHPIZE_DEPS libaio-dev openssl-dev curl-dev \
  && docker-php-ext-configure gd --with-freetype --with-jpeg \
  && docker-php-ext-install -j$(nproc) gd\
  && docker-php-ext-install curl mysqli pdo pdo_mysql zip mbstring sockets bcmath \
  && pecl install amqp-1.11.0 redis-5.3.7 xdebug-3.1.0 \
  && docker-php-ext-enable opcache gd zip amqp redis \
  && apk del .build-deps \ 
  && php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" \
  && php composer-setup.php \ 
  && php -r "unlink('composer-setup.php');" \
  && mv composer.phar /usr/local/bin/composer \
  # 换源
  && composer config -g repo.packagist composer https://packagist.phpcomposer.com 

EXPOSE 9000